package com.smart.smartdata.adapters;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter;
import com.smart.smartdata.R;
import com.smart.smartdata.ble.BleDevice;



public class BleAdapter extends RecyclerArrayAdapter<BleDevice> {
    Context context;

    public BleAdapter(Context context) {
        super(context);
        this.context = context;
    }
    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new BleListViewHolder(parent);
    }

    class BleListViewHolder extends BaseViewHolder<BleDevice> {
        TextView tv_name;

        public BleListViewHolder(ViewGroup itemView) {
            super(itemView, R.layout.item_ble_list);
            this.tv_name = $(R.id.tv_name);
        }

        @Override
        public void setData(BleDevice model) {
            super.setData(model);
            tv_name.setText(model.getName());
        }
    }

}
